package com.xinzhi.controller;



import com.xinzhi.service.ITransferService;
import com.xinzhi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/transfer")
public class PhoneController {

    @Autowired
    private ITransferService transferService;
/**
     * 转账接口
 *
     * @param senderBankAccount 付款人银行卡号
 *            receiverName 收款人姓名
 *            receiverPhoneNumber 收款人手机号
 *            amount 转账金额
 *
     * @return 转账结果
 *
     */
    @PostMapping("/phone")
    public Result transferByPhone(@RequestParam String senderBankAccount,
                                  @RequestParam String receiverName,
                                  @RequestParam String receiverPhoneNumber,
                                  @RequestParam Double amount,
                                  @RequestParam(required = false) String description) {
        return transferService.transfer(senderBankAccount, receiverName, receiverPhoneNumber, amount, description);
    }
}
